<script lang="ts" setup>
const {src} = defineProps<{ src: string }>()

const realSrc = computed(() => {
    if (src && src.includes('/images/') && !src.includes('http')) {
        const newSrc = src.split('.')[0] + '.webp'
        return 'https://cdn.xdproject.top' + newSrc
    } else {
        return src
    }
})
</script>
<template>
    <img :src="realSrc" loading="lazy"/>
</template>